#pragma once
#include "Drawable.h"
#include "Physics.h"
#include "Ball.h"
#include "Model.h"

class CBrick :
	public CDrawable
{
public:
	CBrick();
	~CBrick(void);

	int Draw();
	int Update();

	int SetPosition(double dX, double dY, double dZ);
	int Hit(CBall* pBall);

	int GetType() { return TYPE_BRICK; }
	int GetValue() { return m_iValue; }
	float GetSize() { return m_fSize; }

	static void LoadTexture();
	static void LoadModel(float fSize);
	static void SetModel(CModel* pModel) { m_pModel = pModel; }

private:
	int m_iRemoveTimer;	//Timer that counts steps to destroy.
						//Body cannot be destroyed directly after hit, because ODE needs time
						//to respond.
	int m_iValue;		//points value for destroying
	float m_fSize;		//size of side of brick
	static CModel* m_pModel;
	static GLuint m_uiTexture;
	static GLuint m_uiVBOVertices;
	static GLuint m_uiVBOIndices;
	static GLuint m_uiVBOTexCoords;

	CBat* m_pBat;	//bat to which score will be added

};
